﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using DAO;
using DTO;

namespace BUS
{
    public class HoaBUS
    {
        HoaDAO hoaDAO = new HoaDAO();
        public List<HoaDTO> LayDanhSachHoa()
        {
            return hoaDAO.LayDanhSachHoa();
        }
        public List<HoaDTO> LayDanhSachTenHoa()
        {
            return hoaDAO.LayDanhSachTenHoa();
        }

        public DataTable LoadHoa()
        {
            DataTable dt = new DataTable();
            dt = hoaDAO.LayDSHoa();
            return dt;
        }
        public void ThemHoa(HoaDTO hoa)
        {
            hoaDAO.ThemHoa(hoa);
        }
        public void CapNhatHoa(HoaDTO hoa)
        {
            hoaDAO.CapNhatHoa(hoa);
        }
        public void XoaHoa(HoaDTO hoa)
        {
            hoaDAO.XoaHoa(hoa);
        }

        public DataTable TimKiemHoa(string TenHoa)
        {
            return hoaDAO.TimHoa(TenHoa);
        }
        public HoaDTO TimHoa(string tenHoa)
        {
            return hoaDAO.TimKiemHoa(tenHoa);
        }
        public int LaySoLuongTonHoa(int maHoa)
        {
            return hoaDAO.LaySoLuongTonHoa(maHoa);
        }
    }
}
